package sdk

// 修改商品可用库存请求
type ItemOperateStockRequest struct {
	*BaseRequest
	DeliverCode string `json:"deliverCode"`           // 发货编码: 必填
	ChangeCount int    `json:"changeCount,omitempty"` // 修改库存数量: 可选, 可为正数或负数, 和 availCount 至少有一个必填, 都有值时优先使用 availCount
	AvailCount  int    `json:"availCount,omitempty"`  // 指定库存数量: 可选, 只能为大于等于0的正数, 和 changeCount 至少有一个必填, 都有值时优先使用 availCount
}

//
func (request *ItemOperateStockRequest) GetMethod() (method string) {
	return "/item/operateStock"
}

//
func CreateItemOperateStockRequest() (request *ItemOperateStockRequest) {
	request = &ItemOperateStockRequest{
		BaseRequest: &BaseRequest{},
	}
	return
}

// 修改商品可用库存响应
type ItemOperateStockResponse struct {
	*BaseResponse
}

// 修改商品可用库存
func (client *Client) ItemOperateStock(request *ItemOperateStockRequest) (response *ItemOperateStockResponse, err error) {
	response = &ItemOperateStockResponse{
		BaseResponse: &BaseResponse{},
	}
	err = client.DoAction(request, response)
	return
}
